package com.bindatax.core.util;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class BinDataxTimeUtil {
    private final static ThreadLocal<DateFormat> THREAD_LOCAL_SDF = new ThreadLocal<DateFormat>(){
        @Override
        protected DateFormat initialValue() {
            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        }
    };

    public static String timestampFormatString(Timestamp timestamp){
        return THREAD_LOCAL_SDF.get().format(timestamp);
    }
}
